package com.android.bookgarden.ui;

import android.support.v7.widget.GridLayoutManager;
import android.support.v7.widget.RecyclerView;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

import com.android.bookgarden.R;
import com.android.bookgarden.adapter.SearchAdapter;
import com.android.bookgarden.base.BaseActivity;
import com.android.bookgarden.bean.SearchBean;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;

public class SearchActivity extends BaseActivity implements View.OnClickListener{
    @BindView(R.id.inputSearch)
    EditText inputSearch;
    @BindView(R.id.cancel)
    TextView cancel;
    @BindView(R.id.tjFl)
    RecyclerView tjFl;

    private SearchAdapter adapter;
    private List<SearchBean> list;

    @Override
    protected int getLayoutId() {
        return R.layout.activity_search;

    }

    @Override
    protected void initView() {
        list = new ArrayList<>();
        list.add(new SearchBean("钢琴","1"));
        list.add(new SearchBean("跳舞","1"));
        list.add(new SearchBean("芭蕾舞","1"));
        list.add(new SearchBean("跆拳道","1"));
        list.add(new SearchBean("野外生存","1"));
        adapter = new SearchAdapter(list,SearchActivity.this);
        tjFl.setAdapter(adapter);
        tjFl.setLayoutManager(new GridLayoutManager(this,4));
        cancel.setOnClickListener(this);

    }

    @Override
    public void onRequestPermissions(String str, boolean z) {

    }


    @Override
    public void onClick(View v) {
        switch (v.getId()){
            case R.id.cancel:
                finish();
                break;
        }
    }
}
